/*****************************************************************************/
/*!	\file		IEC61850Functions.h
 *	\brief		C header file for the YX-PIS Example
 *	\par		Dalian Yunxing Tech Co., Ltd.
 *
 *				Dalian, China
 *				Phone   : +86 (411) 8825 4852
 *				Email   : yx@yunxing.tech
 */
/*****************************************************************************/

#ifndef IEC61850_FUNCTIONS_INCLUDED
#define IEC61850_FUNCTIONS_INCLUDED 1

#include <stdio.h>
#include "IEC61850Types.h"
#include "ExampleTypes.h"

IEC61850_ErrorCode GetConnectionsList();

IEC61850_ErrorCode UpdateMMXUPhsAMagi(S32 newValue);
IEC61850_ErrorCode UpdateMMXUPhsBMagi(S32 newValue);
IEC61850_ErrorCode UpdateMMXUPhsCMagi(S32 newValue);

IEC61850_ErrorCode UpdateTTNSTnsSv1Magf(Float32 newValue);
IEC61850_ErrorCode UpdateTTNSTnsSv2Magf(Float32 newValue);
IEC61850_ErrorCode UpdateTTNSTnsSv3Magf(Float32 newValue);

IEC61850_ErrorCode UpdatePDIFCrvPts(CrvPts newValue, S8 index, S8 xy);

void ControlOperateDemo();
void DataAccess();
void ReportOperate();
void LogOperate();
void GooseSVOperate();
void SettingGroupOperate();
void FileOperate();
void RPCAccess();

IEC61850_ErrorCode SelectCSWI(Boolean ctlVal);
IEC61850_ErrorCode OperateCSWI(Boolean ctlVal);

IEC61850_ErrorCode SelectGGIO();
IEC61850_ErrorCode SelectGGIOWithVal(Boolean ctlVal);
IEC61850_ErrorCode OperateGGIO(Boolean ctlVal, int index);

IEC61850_ErrorCode GetServerDir();
IEC61850_ErrorCode GetLDDir();
IEC61850_ErrorCode GetLNDir();
IEC61850_ErrorCode GetAllDataValues();
IEC61850_ErrorCode GetAllDataDefinition();
IEC61850_ErrorCode GetAllCBValues();
IEC61850_ErrorCode GetDataValues();
IEC61850_ErrorCode SetDataValues();
IEC61850_ErrorCode GetDataDirectory();
IEC61850_ErrorCode GetDataDefinition();

IEC61850_ErrorCode CreateDataSet();
IEC61850_ErrorCode DeleteDataSet();
IEC61850_ErrorCode GetDataSetDirectory();
IEC61850_ErrorCode GetDataSetValues();
IEC61850_ErrorCode SetDataSetValues();

IEC61850_ErrorCode GetBufferedReportControlBlockValues();
IEC61850_ErrorCode SetBufferedReportControlBlockValues();
IEC61850_ErrorCode GetUnbufferedReportControlBlockValues();
IEC61850_ErrorCode SetUnbufferedReportControlBlockValues();

IEC61850_ErrorCode GetLCBValues();
IEC61850_ErrorCode SetLCBValues();
IEC61850_ErrorCode QueryLogByTime();
IEC61850_ErrorCode QueryLogAfter();
IEC61850_ErrorCode GetLogStatusValues();

IEC61850_ErrorCode GetGoCBValues();
IEC61850_ErrorCode SetGoCBValues();

IEC61850_ErrorCode GetMSVCBValues();
IEC61850_ErrorCode SetMSVCBValues();

IEC61850_ErrorCode SelectActiveSG();
IEC61850_ErrorCode SelectEditSG();
IEC61850_ErrorCode SetEditSGValue();
IEC61850_ErrorCode ConfirmEditSGValues();
IEC61850_ErrorCode GetEditSGValue();
IEC61850_ErrorCode GetSGCBValues();

IEC61850_ErrorCode CMSGetFile();
IEC61850_ErrorCode CMSSetFile();
IEC61850_ErrorCode CMSDeleteFile();
IEC61850_ErrorCode CMSGetFileAttributeValues();
IEC61850_ErrorCode CMSGetFileDirectory();

IEC61850_ErrorCode GetRpcInterfaceDirectory();
IEC61850_ErrorCode GetRpcMethodDirectory();
IEC61850_ErrorCode GetRpcInterfaceDefinition();
IEC61850_ErrorCode GetRpcMethodDefinition();
IEC61850_ErrorCode RpcCall();

IEC61850_ErrorCode Discover(U32 type);

IEC61850_ErrorCode InnerTestClient();
IEC61850_ErrorCode InnerTestServer();

#endif
